home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / tweak16b.zip / MISC / VGA.TXT < prev    next >
Text File  |  1993-01-22  |  26KB  |  552 lines

  1.        3C0h:  Attribute Controller: Address register
  2.        bit 0-4  Address of data register to write to port 3C0h
  3.         or read from port 3C1h (Reads only on VGA).
  4.          5  If set screen output is enabled and the palette can not be
  5.         modified, if clear screen output is disabled and the palette
  6.         can be modified.
  7.  
  8.  
  9.      Port 3C0h is special in that it is both address and data-write
  10.      register. Data reads happen from port 3C1h. An internal
  11.      flip-flop remembers whether it is currently acting as
  12.      address or data register.
  13.      Accesses to the attribute controller must be separated by
  14.      at least 250ns.
  15.      Reading port 3dAh will reset the flip-flop to address mode.
  16.  
  17.  
  18.        3C0h index 0-Fh  (r/W): Attribute: Palette
  19.      bit 0  (EGA) Primary Blue
  20.          1  (EGA) Primary Green
  21.          2  (EGA) Primary Red
  22.          3  (EGA) Secondary Blue
  23.          4  (EGA) Secondary Green
  24.          5  (EGA) Secondary Red
  25.        0-5  (VGA) Index into the 256 color DAC table.
  26.               May be modified by 3C0h index 10h and 14h.
  27.  
  28.        3C0h index 10h (r/W): Attribute: Mode Control Register
  29.      bit 0  Graphics mode if set, Alphanumeric mode else.
  30.          1  Monochrome mode if set, color mode else.
  31.          2  9-bit wide characters if set.
  32.         The 9th bit of characters C0h-DFh will be the same as
  33.         the 8th bit. Otherwise it will be the background color.
  34.          3  If set Attribute bit 7 is blinking, else high intensity.
  35.          5  (VGA Only) If set the PEL panning register (3C0h index 13h)
  36.                is temporarily set to 0 from when the line
  37.                compare causes a wrap around until the next
  38.                vertical retrace when the register is automatically
  39.                reloaded with the old value, else the PEL
  40.                panning register ignores line compares.
  41.          6  (VGA Only) If set pixels are 8 bits wide.
  42.                Used in 256 color modes.
  43.          7  (VGA Only) If set bit 4-5 of the index into the DAC table
  44.                are taken from port 3C0h index 14h bit 0-1,
  45.                else the bits in the palette register are used.
  46.  
  47.        3C0h index 11h (r/W): Attribute: Overscan Color Register.
  48.        bit 0-5  Color of screen border. Color is defined as in the
  49.         palette registers.
  50.        Note: The EGA requires the Overscan color to be 0 in high resolution
  51.          modes.
  52.  
  53.        3C0h index 12h (r/W): Attribute: Color Plane Enable Register
  54.      bit 0  Bit plane 0 is enabled if set.
  55.          1  Bit plane 1 is enabled if set.
  56.          2  Bit plane 2 is enabled if set.
  57.          3  Bit plane 3 is enabled if set.
  58.        4-5  Video Status MUX. Diagnostics use only.
  59.         Two attribute bits appear on bits 4 and 5 of the Input
  60.         Status Register 1 (3dAh).
  61.           Value       EGA            VGA
  62.             0      Red/Blue        Bit 2/Bit 0
  63.             1      Blue'/Green     Bit 5/Bit 4
  64.             2      Red'/Green'     Bit 3/Bit 1
  65.             3                      Bit 7/Bit 6
  66.  
  67.        3C0h index 13h (r/W): Attribute: Horizontal PEL Panning Register
  68.        bit 0-3  Indicates number of pixels to shift the display left
  69.          Value  9bit textmode   256color mode   Other modes
  70.             0          1               0              0
  71.             1          2              n/a             1
  72.             2          3               1              2
  73.             3          4              n/a             3
  74.             4          5               2              4
  75.             5          6              n/a             5
  76.             6          7               3              6
  77.             7          8              n/a             7
  78.             8          0              n/a            n/a
  79.  
  80.        3C0h index 14h (r/W): Attribute: Color Select Register  (VGA Only)
  81.        bit 0-1  If 3C0h index 10h bit 7 is set these 2 bits are used
  82.         as bits 4-5 of the index into the DAC table.
  83.        2-3  These 2 bits are used as bit 6-7 of the index into the
  84.         DAC table except in 256 color mode.
  85.  
  86.        Note: this register does not affect 256 color modes.
  87.  
  88.  
  89.        3C2h (R): Input Status #0 Register
  90.      bit 4  Status of the switch selected by the Miscellaneous Output
  91.         Register 3C2h bit 2-3. Switch high if set.
  92.          5  (EGA Only) Pin 19 of the Feature Connector (FEAT0)
  93.                is high if set
  94.          6  (EGA Only) Pin 17 of the Feature Connector (FEAT1)
  95.                is high if set
  96.          7  (EGA Only ??) If set IRQ 2 has happened due to Vertical
  97.               Retrace. Should be cleared by IRQ 2 interrupt routine
  98.               by clearing port 3d4h index 11h bit 4.
  99.  
  100.  
  101.        3C2h (W): Miscellaneous Output Register
  102.      bit 0  If set Color Emulation. Base Address=3Dxh
  103.         else Mono Emulation. Base Address=3Bxh.
  104.          1  Enable CPU Access to video memory if set
  105.        2-3  Clock Select
  106.           0: 14MHz(EGA)     25MHz(VGA)
  107.           1: 16MHz(EGA)     28MHz(VGA)
  108.           2: External(EGA)  Reserved(VGA)
  109.          4  (EGA Only) Disable internal video drivers if set
  110.          5  When in Odd/Even modes Select High 64k bank if set
  111.          6  Horizontal Sync Polarity. Negative if set
  112.          7  Vertical Sync Polarity. Negative if set
  113.         Bit 6-7 indicates the number of lines on the display:
  114.              0=200(EGA)  Reserved(VGA)
  115.              1=          400(VGA)
  116.              2=350(EGA)  350(VGA)
  117.              3=          480(VGA).
  118.  
  119.        Note: Set to all zero on a hardware reset.
  120.        Note: On the VGA this register can be read from port 3CCh.
  121.  
  122.  
  123.        3C3h (W): Video Subsystem Enable Register
  124.      bit 0  Enables the VGA display if set
  125.  
  126.  
  127.        3C4h index  0  (r/W): Sequencer: Reset
  128.      bit 0  (EGA) Asynchronous Reset if clear
  129.          0  (VGA) Synchronous Reset just as bit 1
  130.          1  Synchronous Reset if clear
  131.  
  132.        3C4h index  1  (r/W): Sequencer: Clocking Mode
  133.      bit 0  If set character clocks are 8 dots wide, else 9.
  134.          1  (EGA Only) If set the CRTC uses 2/5 of the clock cycles, else 4/5.
  135.          2  If set loads video serializers every other character
  136.         clock cycle, else every one.
  137.          3  If set the Dot Clock is Master Clock/2, else same as
  138.         Master Clock (See 3C2h bit 2-3). (Doubles pixels).
  139.          4  (VGA Only) If set loads video serializers every fourth
  140.                character clock cycle, else every one.
  141.          5  (VGA Only) if set turns off screen and gives all memory
  142.                cycles to the CPU interface.
  143.  
  144.        3C4h index  2  (r/W): Sequencer: Map Mask Register
  145.      bit 0  Enable writes to plane 0 if set
  146.          1  Enable writes to plane 1 if set
  147.          2  Enable writes to plane 2 if set
  148.          3  Enable writes to plane 3 if set
  149.  
  150.        3C4h index  3  (r/W): Sequencer: Character Map Select Register
  151.        bit 0-1  (EGA) Selects EGA Character Map (0..3) if bit 3 of
  152.               the character attribute is clear.
  153.        2-3  (EGA) Selects EGA Character Map (0..3) if bit 3 of
  154.               the character attribute is set.
  155.      0,1,4  (VGA) Selects VGA Character Map (0..7) if bit 3 of
  156.               the character attribute is clear.
  157.      2,3,5  (VGA) Selects VGA Character Map (0..7) if bit 3 of
  158.               the character attribute is set.
  159.  
  160.           Character Maps are placed at:
  161.            Map no. (EGA/VGA)       Map no. (VGA)
  162.               0       0k              4      8k
  163.               1      16k              5     24k
  164.               2      32k              6     40k
  165.               3      48k              7     56k
  166.  
  167.        3C4h index  4  (r/W): Sequencer: Memory Mode Register
  168.      bit 0  Set if in an alphanumeric mode, clear in graphics modes.
  169.          1  Set if more than 64kbytes on the adapter.
  170.          2  Enables Odd/Even addressing mode if set.
  171.         Odd/Even mode places all odd bytes in plane 1&3, and
  172.         all even bytes in plane 0&2.
  173.          3  (VGA Only)  If set address bit 0-1 selects video memory
  174.                 planes (256 color mode), rather than the
  175.                 Map Mask and Read Map Select Registers.
  176.  
  177.        3C4h index 7 (R/W): Sequencer Horizontal Character Counter Reset Register.
  178.                (VGA  Only).
  179.        Note: Undocumented by IBM. May not be available in all clones.
  180.        Note: A write to this register will cause the Horizontal Character Counter
  181.          to be held reset (=0) until a write happens to any of the Sequencer
  182.          registers index 0..6.
  183.          The Vertical Line counter is clocked by a signal derived from the
  184.          Horizontal Display Enable (which does not occur if the Horizontal
  185.          Character Counter is held reset).
  186.          Thus a write to index 7 during Vertical Retrace can stop the display
  187.          timing and allow software to